#include <stdio.h>
#include <unistd.h>
#include <string.h>
#define NUM 100
int main()
{
  char arr[NUM+1];
  memset(arr, 0, sizeof(arr));
  
  int i = 0;
  const char* lable="|/-\\";
  while(i<100)
  {
    arr[i++] = '#';
    printf("[%-100s][%3d%%][%c]\r", arr, i, lable[i%4]);
    fflush(stdout);

    usleep(10000);
  }
  printf("\n");
  return 0;
}
